﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Vowei.Core.Models;


namespace Vowei.Core.Models
{
    /// <summary>
    /// 表示一个客户的需求
    /// </summary>
    [DataContract]
    public class Requirement : Ticket, IContainer<Ticket>
    {
        public Requirement()
        {
            Children = new List<Ticket>();
        }

        /// <summary>
        /// 实现这个客户需求能够获得的商业价值
        /// </summary>
        [DataMember]
        [Display(Name = "商业价值")]
        public float BusinessValue { get; set; }
        
        IQueryable ITableItemContainer.Children
        {
            get
            {
                return Children.AsQueryable();
            }
        }

        [Display(Name = "子需求或者任务")]
        // public virtual List<Ticket> Children { get; private set; }
        public virtual List<Ticket> Children { get; set; }
    }
}
